<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="/EA/Public/Css/themes/bootstrap/easyui.css" />
<link rel="stylesheet" type="text/css" href="/EA/Public/Css/themes/icon.css" />
<link rel="stylesheet" type="text/css" href="/EA/Public/Css/css.css" />
<script type="text/javascript" src="/EA/Public/Js/jquery.min.js"></script>
<script type="text/javascript" src="/EA/Public/Js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="/EA/Public/Js/jquery.validatebox.fixed.js"></script>
<script type="text/javascript" src="/EA/Public/Js/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="/EA/Public/Js/myutil.js"></script>
<title><?php echo ((isset($title) && ($title !== ""))?($title):"系统管理"); ?></title>
</head>
<body>
<div class="easyui-layout" data-options="fit:true">
	<div data-options="region:'north',border:false"></div>
	<div data-options="region:'center',border:false">
		<style type="text/css">
		.wx_menu {width:231px; position:relative;margin:0 auto;top:430px;left:2px;}
		.wx_menu li { border:1px solid #ccc;width:74.9px;height:40px;line-height:40px;text-align:center;float:left;position:relative;cursor:pointer;}
		.wx_menu ul {padding:0; margin:0;}
		.wx_menu ul li ul {display:block; position:absolute; bottom:40px;}
		.wx_menu ul li ul li {left:-1px;}
		.wx_menu ul li ul li ul {display: none;left:210px;}
		</style>
		<div style="background-image: url(/EA/Public/Img/phone.jpg);width:270px;height:550px;float: left;">
			<div class="wx_menu">
				<ul>
					<?php if(is_array($menu)): foreach($menu as $key=>$vo): ?><li class="level_one_menu">
					    	<div><?php echo ($vo["name"]); ?></div>
					        <ul>
					        	<?php if(is_array($vo["sub_button"])): foreach($vo["sub_button"] as $key=>$v1): ?><li class="level_two_menu">
										<a><?php echo ($v1["name"]); ?></a>
							        </li><?php endforeach; endif; ?>
					        </ul>
					    </li><?php endforeach; endif; ?>
				</ul>
			</div>
		</div>
		<div style="float:left;border:1px solid #ccc;width:400px;height:300px;margin: 100px 0 0 100px;">
			<div></div>
		</div>
	</div>
	
</div>
<script>
NameSpace("My.wx",function(){
var context = this;
context.ready = function(){
	context.checkMenuNum();
	$('.level_one_menu').children().not('ul').on('click', function(e){

	});
}
context.doSubmit = function(){
	$api_form = $('#winxin_api_form');
	if ($api_form.form('validate')) {
		$.post("<?php echo U('Winxin/Api/doUpdate');?>", $api_form.toJson(),
				function(ret){
					if (ret.status) {

					} else {

					}
				});
	}
}
context.checkMenuNum = function(){
	var num = $('.level_one_menu').length;
	for (var i = 1; i <= 3; i++) {
		if (i <= num) {
			context.checkChildNum($('.level_one_menu > ul').eq(i - 1));
		} else {
			$('.wx_menu > ul').append(
					'<li class="level_one_menu"><div>添加</div></li>');
		}
	}
}
context.checkChildNum = function(ul){
	var num = ul.find('li').length;
	console.info(num);
	if (num < 5) {
		console.info();
		ul.prepend('<li class="level_one_menu"><div>添加</div></li>');
	}
}
});
</script>
</body>
</html>